package com.dragon.repository.domain.dto;

import com.dragon.repository.entity.VendorType;
import lombok.Data;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.dragon.common.util.BeanUtils;

import java.util.ArrayList;
import java.util.List;
import java.util.Date;


/**
 * @author sy
 */
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
public class VendorTypeDTO {

    private static final long serialVersionUID = 1L;

    private Integer id;

    @ApiModelProperty(value = "名称")
    private String name;

    @ApiModelProperty(value = "禁用：否，1，是")
    private Integer state;

    @ApiModelProperty(value = "删除标识：0未删，1删除")
    private Integer deleted;

    @ApiModelProperty(value = "创建时间")
    private Date createTime;

    @ApiModelProperty(value = "修改时间")
    private Date updateTime;


    public VendorTypeDTO() {}

    public VendorTypeDTO(VendorType entity) {
        BeanUtils.copyProperties(entity,this);
    }

    public static VendorTypeDTO convert(VendorType entity) {
        return new VendorTypeDTO(entity);
    }

    public static List<VendorTypeDTO> convertList(List<VendorType> list) {
        List<VendorTypeDTO> resultList = new ArrayList<>();
        for (VendorType entity : list) {
            resultList.add(new VendorTypeDTO(entity));
        }
        return resultList;
    }}
